home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / dbms_mag / 9108 / bench1.aug < prev    next >
Text File  |  1991-07-19  |  877b  |  36 lines

  1. Listing 1
  2.  
  3.  
  4. USE Benchmark
  5. go
  6. drop procedure AG_XACT29
  7. go
  8. CREATE PROCEDURE AG_XACT29 (
  9.       /*-------------------------------------------*/
  10.       /*                                           */
  11.       /* TRANSACTION 29: Product by Price Category */
  12.       /*                                           */
  13.       /*-------------------------------------------*/
  14.  
  15.    @Quantity  int   = NULL,
  16.    @FromPrice money = NULL,
  17.    @ToPrice   money = NULL)
  18.  
  19. AS BEGIN
  20.    set forceplan on
  21.    
  22.    SELECT   PT.Name, COUNT(*)
  23.    FROM     PricingPolicy PP,ProductTyping T, ProductTypes PT 
  24.    WHERE    PT.ID  = T.ProductTypeID
  25.      AND    T.ProductID  = PP.ProductID
  26.      AND    PP.Quantity  = @Quantity
  27.      AND    (PP.Price BETWEEN @FromPrice AND @ToPrice)
  28.    GROUP BY PT.Name
  29.    ORDER BY 2 DESC
  30.    set forceplan off
  31.  
  32. END
  33. go
  34. GRANT ALL ON AG_XACT29 TO PUBLIC
  35. go
  36.